home *** CD-ROM | disk | FTP | other *** search
/ Macromedia Multimedia Showcase 6.0 / Macromedia Multimedia Showcase v6.0 WIN-MAC (XMSH60CD)(Macromedia, Inc.)(1996).iso / pc / demosoft / xres / data.z / INIT.PS < prev    next >
Text File  |  1996-05-10  |  8KB  |  243 lines

  1. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2. %%                                                                  %%
  3. %% init.ps:  this file is read in to the PostScript interpreter as  %%
  4. %% soon as all the built-in operators have been defined.            %%
  5. %%                                                                  %%
  6. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  7.  
  8.  
  9. true setglobal
  10.  
  11.  
  12. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  13. %%                                                                  %%
  14. %%  Time to load in some standard PostScript files.                 %%
  15. %%                                                                  %%
  16. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  17.  
  18. (%lib%utils.ps) run
  19.  
  20. (%lib%errordict.ps) run
  21.  
  22. (%lib%resources.ps) run
  23.  
  24. (%lib%statusdict.ps) run
  25.  
  26. (%lib%local.ps) run
  27.  
  28.  
  29. %% Added so that font decoding (not encoding!) is available always,
  30. %% everywhere.  C.C. - 2/26/96
  31. (%lib%decoding.ps) run
  32.  
  33. /TProSpot
  34. {
  35.     exch pop
  36. } binddef
  37.  
  38.  
  39. /TestHalfTone <<
  40.   /HalftoneType 3
  41.   /Width 4
  42.   /Height 4
  43.   /Thresholds <
  44.     00 44 66 88
  45.     ff 11 aa ee
  46.     99 77 22 cc
  47.     dd bb 55 33
  48.   >
  49. >> /Halftone defineresource
  50.  
  51.  
  52. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  53. %%                                                                  %%
  54. %% Define the job server and other contents of serverdict           %%
  55. %%                                                                  %%
  56. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  57.  
  58. systemdict /serverdict 16 dict put
  59. serverdict begin
  60.  
  61. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  62. %%                                                                  %%
  63. %% The following variable says whether you get a looping or a       %%
  64. %% single-shot job server.                                          %%
  65. %%                                                                  %%
  66. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  67.  
  68. /onejobonly false def
  69.  
  70.  
  71. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  72. %%                                                                  %%
  73. %% setdefaultdevice simply applies all the initial values           %%
  74. %%                                                                  %%
  75. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  76.  
  77.  
  78. /setdefaultdevice {
  79. %%  serverdict /initialdevicedict get setpagedevice
  80.   /DefaultType1Halftone /Halftone findresource sethalftone
  81.   /DefaultColorRendering /ColorRendering findresource setcolorrendering
  82. } binddef
  83.  
  84.  
  85. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  86. %%                                                                  %%
  87. %% The initial page device dictionary sets a fairly minimal set     %%
  88. %% of values.                                                       %%
  89. %%                                                                  %%
  90. %% The /OutputDevice string selects the an appropriate TPro device  %%
  91. %% driver, as described in the manual.                              %%
  92. %%                                                                  %%
  93. %% Some devices (such as (fileband;roll;....) have strange initial  %%
  94. %% page sizes.  On such a device, PS jobs which don't explicitly    %%
  95. %% select a paper size will produce odd looking results.  When      %%
  96. %% using such a device, you should add a /PageSize entry to the     %%
  97. %% initial dictionary, like the one below.  This will get overridden%%
  98. %% by any job that really does request a page size.                 %%
  99. %%                                                                  %%
  100. %% I set the page size policy to 3, so that requests for weird      %%
  101. %% paper sizes get the page scaled to fit the available paper. This %%
  102. %% is not what is described in the PLRM, but is quite useful.       %%
  103. %%                                                                  %%
  104. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  105.  
  106. %%/initialdevicedict <<
  107. %%  /PageDeviceName /Default
  108. %%  /OutputDevice
  109. %% (filepage;format=tiffpackbits;filename=c:/tpro%03d.out)
  110. %%  /BeginPage {pop}
  111. %%  /EndPage {exch pop 2 ne}
  112. %%  /Install {
  113. %%  }
  114. %%  /Policies <<
  115. %%    /PolicyNotFound 0
  116. %%    /PageSize 3
  117. %%  >>
  118. %%  /PageSize [612 792]
  119. %%>> def
  120.  
  121.  
  122. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  123. %%                                                                  %%
  124. %% You may also want to establish a default set of user parameters  %%
  125. %% that get applied to each job.                                    %%
  126. %%                                                                  %%
  127. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  128.  
  129. /initialuserparams <<
  130.   /IgnoreDOSChars true
  131. %%  /AccurateScreens true
  132. %%  /CMYKOverprint true
  133. %%  /CommentDict << /CommentNotFound {==} >>
  134. >> def
  135.  
  136.  
  137. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  138. %%                                                                  %%
  139. %% Finally, there is the job server itself.                         %%
  140. %%                                                                  %%
  141. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  142.  
  143. /server {
  144.   serverdict /setdefaultdevice get exec
  145.   {
  146.     clear cleardictstack
  147.     serverdict /stdin (%stdin) (r) file put
  148.     save serverdict /serversave 3 -1 roll put
  149.     /quit /stop load def
  150.     false setglobal
  151.     serverdict /initialuserparams get setuserparams
  152.     serverdict /stdin get cvx stopped {
  153.       $error /newerror get {
  154.         $error /errorname get
  155.         false errordict /backstoperrors get {
  156.           2 index eq {pop true exit} if
  157.         } forall
  158.         {
  159.           errordict begin errorbackstop end
  160.         } {
  161.           errordict begin handleerror end
  162.         } ifelse
  163.         $error /binary get currentobjectformat 0 ne and not {
  164.           (%%[ Flushing: rest of job (to end-of-file) will be ignored ]%%) =
  165.           flush
  166.         } if
  167.         serverdict /stdin get flushfile
  168.       } if
  169.     } if
  170.     clear cleardictstack
  171.     serverdict /serversave get dup null ne
  172.       {restore} {pop clearerrorstacks} ifelse
  173.     serverdict /endjob get exec
  174.     serverdict begin
  175.     /serversave null store
  176.     stdin closefile
  177.     /stdin null store
  178.     end
  179.     serverdict /onejobonly get {exit} if
  180.   } loop
  181. } binddef
  182.  
  183. /serversave null def
  184.  
  185. /endjob /endjob load def
  186. systemdict /endjob undef
  187.  
  188. /exitserver {
  189.   true exch startjob not {
  190.     /exitserver errordict /invalidaccess get exec
  191.   } {
  192.     (%%[ exitserver: permanent state may be changed ]%%\n) print flush
  193.   } ifelse
  194. } binddef
  195.  
  196. systemdict /startjob {
  197.   checkjobpassword
  198.   vmstatus pop pop serverdict /serversave get
  199.   null ne {1} {0} ifelse le and {
  200.     count 1 gt {count 1 roll} if
  201.     count 1 sub {pop} repeat
  202.     cleardictstack
  203.     serverdict /serversave get dup null eq {
  204.       pop true
  205.     } {
  206.       {restore} stopped {
  207.         pop false
  208.       } {
  209.         serverdict /endjob get exec
  210.         serverdict /serversave null put
  211.         false setglobal
  212.         true
  213.       } ifelse
  214.     } ifelse
  215.     exch not 1 index and {
  216. %% Start encapsulated job
  217.       save serverdict /serversave 3 -1 roll put
  218.       /quit /stop load def
  219.       false setglobal
  220.     } if
  221.   } {
  222.     pop false
  223.   } ifelse
  224. } bind put
  225.  
  226.  
  227. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  228. %%                                                                  %%
  229. %% Until now, systemdict has been writable.                         %%
  230. %%                                                                  %%
  231. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  232.  
  233. systemdict readonly pop
  234.  
  235. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  236. %%                                                                  %%
  237. %% Everything's ready, so start the job server.                     %%
  238. %%                                                                  %%
  239. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  240.  
  241. serverdict /server get exec
  242.  
  243.